//
//  DataViewController.m
//  iOSCodeLearning
//
//  Created by Ace on 2017/11/1.
//  Copyright © 2017年 Ace. All rights reserved.
//
typedef enum {
    
    WccEnumTop,
    WccEnumBottom,
    
}WccEnum;
// 可以定义枚举的类型
typedef NS_ENUM(NSInteger,WccNsEnum) {
    WccNsEnumTop,
    WccNsEnumBottom,
};
// 位移枚举 一个参数可以传多个值
typedef NS_OPTIONS(NSInteger, WccNsOptions) {
    
    WccNsOptionsTop = 1<<0,//1 = 1 * 2^0
    WccNsOptionsBottom= 1<<1,//2 = 1*2^1
    WccNsOptionsLeft= 1<<2,//4 = 1 * 2^2
    WccNsOptionsRight= 1<<3,//8 =1 * 2^3
    
};
#import "DataViewController.h"

 NSString * vcName = @"DataViewController";

@interface DataViewController ()

@end

@implementation DataViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"位移枚举";
    self.view.backgroundColor = [UIColor whiteColor];
    
    static NSString *test = @"test";

}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{

    [self p_NS_OPTIONS:WccNsOptionsBottom | WccNsOptionsLeft];
}

-(void)p_NS_OPTIONS : (WccNsOptions)type{
    if (type & WccNsOptionsTop)
    {
        NSLog(@"向上=====type & WccNsOptionsTop");
    }
    
    if (type & WccNsOptionsRight)
    {
         NSLog(@"向右=====type & WccNsOptionsRight");
    }
    
    if (type & WccNsOptionsLeft)
    {
        NSLog(@"向左 =====type & WccNsOptionsLeft");
    }
    
    if (type & WccNsOptionsBottom) {
        NSLog(@"向下 ====type & WccNsOptionsBottom");
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
  
}



@end
